package com.xueyi.aixihu.reqeust;

import com.xueyi.aixihu.reqeust.base.PageLimitReq;
import lombok.Data;
import org.springframework.util.StringUtils;

import javax.validation.constraints.NotNull;

/**
 * @author 俞烨
 * @version 1.0
 * @description: 查询审核报表的DTO
 * @date 2023/12/10 22:21
 */
@Data
public class FindAuditFinanceDto extends PageLimitReq {

    private Integer isAlreadyProcess;

    private String keyword;
    private String month;
    private String fromToAreaIds;
    private Integer areaType;
    private Integer reportType;
    private String areaTypeStr;
    @NotNull(message = "页面类型不能为空")
    private Integer pageType;

    public void format() {
        isAlreadyProcess = isAlreadyProcess == null ? 0 : isAlreadyProcess;
        keyword = StringUtils.hasLength(keyword) ? keyword : null;
        month = StringUtils.hasLength(month) ? month : null;
        areaTypeStr = StringUtils.hasLength(areaTypeStr) ? areaTypeStr : null;
        fromToAreaIds = StringUtils.hasLength(fromToAreaIds) ? fromToAreaIds : null;
        countStartIndex();
    }
}
